#include <rtdevice.h>
#include <rtthread.h>
#include <board.h>

void usb_hc_low_level_init(uint8_t busid)
{
    extern void HAL_PCD_MspInit(PCD_HandleTypeDef* hpcd);
    HAL_PCD_MspInit(&(PCD_HandleTypeDef){
        .Instance = USB_OTG_HS
    });
}

void OTG_HS_IRQHandler(void)
{
    extern void USBH_IRQHandler(uint8_t busid);
    USBH_IRQHandler(0);
}

int usbh_msp_init(void)
{
    usb_hc_low_level_init(0);
    return 0;
}

INIT_COMPONENT_EXPORT(usbh_msp_init);